From 42996316f55b1ba88facded4b9d46278720b8e11 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 11 Aug 2005 22:18:02 +0000 Subject: [PATCH] domU always reports an error "Ignoring shutdown request: -1" when we shutdown it from dom0 (using "xm shutdown" command). This patch fixes it. Signed-off-by: Nguyen Anh Quynh --- linux-2.6-xen-sparse/arch/xen/kernel/reboot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c index 683ddba5ed..585c94e282 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -254,7 +255,8 @@ static void shutdown_handler(struct xenbus_watch *watch, const char *node) char *str; str = (char *)xenbus_read("control", "shutdown", NULL); - if (IS_ERR(str)) + /* Ignore read errors and recursive shutdown events. */ + if (IS_ERR(str) || !strcmp(str, __stringify(SHUTDOWN_INVALID))) return; xenbus_printf("control", "shutdown", "%i", SHUTDOWN_INVALID); -- 2.30.2